package com.wgworkshop.pems.model;

import com.wgworkshop.pems.checkgroup.CreateCheckGroup;
import com.wgworkshop.pems.checkgroup.PatchCheckGroup;
import com.wgworkshop.pems.checkgroup.UpdateCheckGroup;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 课时模型。
 * Created by wlc on 2017/7/7.
 */
public class ClassHourModel {
    @Null(message = "课时ID只能为null。",
            groups = {CreateCheckGroup.class, PatchCheckGroup.class})
    @NotNull(message = "课时ID不能为null。",
            groups = UpdateCheckGroup.class)
    @Min(value = 1,
            message = "不正确的课时ID[${validatedValue}]。",
            groups = UpdateCheckGroup.class)
    private Long id;

    @NotNull(message = "学生ID不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Min(value = 1,
            message = "不正确的学生ID[${validatedValue}]。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Long studentId;

    @NotNull(message = "课时不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    @Min(value = -32768,
            message = "不正确的课时[${validatedValue}]，课时最小值为{value}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    @Max(value = 32767,
            message = "不正确的课时[${validatedValue}]，课时最大值为{value}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private Integer classHour;

    @DecimalMin(value = "-1000000.00",
            inclusive = false,
            message = "不正确的课时费[${validatedValue}]，课时费最小值为{value}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    @DecimalMax(value = "1000000.00",
            inclusive = false,
            message = "不正确的课时费[${validatedValue}]，课时费最小值为{value}。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class, PatchCheckGroup.class})
    private BigDecimal cost;

    @NotNull(message = "操作日期不能为null。",
            groups = {CreateCheckGroup.class, UpdateCheckGroup.class})
    private Date operateDate;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getStudentId() {
        return studentId;
    }

    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    public Integer getClassHour() {
        return classHour;
    }

    public void setClassHour(Integer classHour) {
        this.classHour = classHour;
    }

    public BigDecimal getCost() {
        return cost;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    public Date getOperateDate() {
        return operateDate;
    }

    public void setOperateDate(Date operateDate) {
        this.operateDate = operateDate;
    }
}
